import Vue from 'vue'
import App from './App.vue'
import router from './router'
import api from "@/services"
import store from './store'
import CKEditor from '@ckeditor/ckeditor5-vue2';

Vue.use(CKEditor);

Vue.use(router).use(store)
Vue.prototype.$api = api;

import 'ant-design-vue/dist/antd.less'
import './assets/styles/global.scss'
import {
    Upload, Progress, Modal, message, TreeSelect, Popover, Table, Form,
    Dropdown, Avatar, Slider, Spin, Divider, DatePicker, Menu, Tag,
    Tooltip, Button, Rate, Icon, Tabs, Select, Input, Checkbox, InputNumber,
} from 'ant-design-vue'
import * as filters from './filters/index.js'
Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));

Vue.use(Upload).use(Popover).use(Progress).use(Modal).use(Dropdown).use(Avatar).use(Form)
    .use(Menu).use(Tooltip).use(Button).use(Rate).use(Icon).use(Tabs).use(Select).use(Input)
    .use(Slider).use(Checkbox).use(Spin).use(Divider).use(TreeSelect).use(DatePicker)
    .use(Table).use(InputNumber).use(Tag)

message.config({
    duration: 2,
    maxCount: 3,
})
Vue.prototype.$message = message
Vue.prototype.$confirm = function confirm(title, callback) {
    Modal.confirm({
        okText: '确认',
        cancelText: '取消',
        title: title,
        content: '',
        onOk: () => {
            return callback();
        }
    })
}

Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: function (h) { return h(App) }
}).$mount('#app')

